home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / etc / init.d / brltty < prev    next >
Encoding:
Text File  |  2007-03-27  |  1.4 KB  |  58 lines

  1. #! /bin/sh
  2.  
  3. PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
  4. DAEMON=/sbin/brltty
  5. NAME=brltty
  6. DESC='Braille terminal driver'
  7. PIDFILE=/var/run/$NAME.pid
  8.  
  9. test -f $DAEMON || exit 0
  10.  
  11. # /etc/brltty.conf may need to be propagated from the initramfs. (This is a
  12. # pretty awful hack.)
  13. if [ -e /dev/.initramfs/brltty.conf ] && [ -e /etc/default/brltty ]; then
  14.     if [ -e /etc/brltty.conf ]; then
  15.         mv /etc/brltty.conf /etc/brltty.conf.orig
  16.     fi
  17.     mv /dev/.initramfs/brltty.conf /etc/brltty.conf
  18.     sed -i -e 's/^RUN_BRLTTY=.*/RUN_BRLTTY=yes/' /etc/default/brltty
  19. fi
  20.  
  21. [ ! -f /etc/default/brltty ] || . /etc/default/brltty
  22.  
  23. # Edit /etc/default/brltty and set RUN_BRLTTY=yes to allow brltty to be
  24. # started.
  25. if [ "$RUN_BRLTTY" != yes ]; then
  26.     exit 0
  27. fi
  28.  
  29. set -e
  30.  
  31. case "$1" in
  32.   start)
  33.     echo -n "Starting $DESC: "
  34.     start-stop-daemon --start --oknodo \
  35.         --pidfile $PIDFILE --startas $DAEMON -- -P $PIDFILE
  36.     echo "$NAME."
  37.     ;;
  38.   stop)
  39.     echo -n "Stopping $DESC: "
  40.     start-stop-daemon --stop --quiet --oknodo --retry 5 --pidfile $PIDFILE
  41.     echo "$NAME."
  42.     ;;
  43.   restart|force-reload)
  44.     echo -n "Restarting $DESC: "
  45.     start-stop-daemon --stop --quiet --retry 5 --pidfile $PIDFILE
  46.     start-stop-daemon --start --quiet \
  47.         --pidfile $PIDFILE --startas $DAEMON -- -P $PIDFILE
  48.     echo "$NAME."
  49.     ;;
  50.   *)
  51.     N=/etc/init.d/$NAME
  52.     echo "Usage: $N {start|stop|restart|force-reload}" >&2
  53.     exit 1
  54.     ;;
  55. esac
  56.  
  57. exit 0
  58.